package tdh.xt.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import tdh.xt.entity.vo.ResultDto;
import tdh.xt.enums.CustomResultCode;
import tdh.xt.service.DepartService;

/*
* @Package tdh.xt.controller
* @Description 部门Controller
* @Author RicarAN
* @Date 2021/6/15 16:03
* @Copyright (c) 2021,南京通达海科技股份有限公司 All Rights Reserved.
* @Version 1.0
* Modification History:
* Date                  Author      Version     Description
* ------------------------------------------------------------------
* 2021/6/15 16:03       RicarAN      1.0        部门Controller
*
*/
@Controller
public class DepartController {

    @Autowired
    DepartService departService;

    /*
     * @description 获取部门树
     * @param model model
     * @return java.lang.String json化的部门树
     * @author RicarAN
     * @version 1.0
     * @date 2021/6/15 16:03
     */
    @RequestMapping("/departTree.do")
    @ResponseBody
    public ResultDto departTree() {
        return ResultDto.okOf(CustomResultCode.SUCCESS, departService.getAllDepart());
    }
}
